package com.linkoog.devtools.code_generator.template.render.engine;

import com.linkoog.devtools.code_generator.template.render.engine.jtemplate.JtplTemplateEngine;
import com.linkoog.devtools.code_generator.template.render.engine.velocity.VelocityTemplateEngine;
import com.intellij.openapi.externalSystem.service.execution.NotSupportedException;
import org.jetbrains.annotations.NotNull;

public class TemplateEngineFactory {


    public static TemplateEngine getTemplateEngine(@NotNull TemplateType templateEngineType){
        if (TemplateType.JTPL == templateEngineType){
            return new JtplTemplateEngine();
        } else if (TemplateType.VELOCITY == templateEngineType){
            return new VelocityTemplateEngine();
        }
        throw new NotSupportedException("不支持该模板引擎！");
    }

}
